<tagLib name="html" />
<include file="Public:header" />

<div class="container" id="cpcontainer">
   <div class="itemtitle">
        <h3>{$Think.lang.newsletter.manage_newsletter}</h3>
        <ul class="tab1">
            <li class="current"><a href="__URL__/newsletterList"><span>{$Think.lang.newsletter.all_newsletter}</span></a></li>
            <li><notempty name="rs"><a href="__URL__/editNewsletter/letter_id/{$rs.letter_id}"><span>{$Think.lang.newsletter.edit_newsletter}</span></a><else/><a href="__URL__/addNewsletter"><span>{$Think.lang.newsletter.add_newsletter}</span></a></notempty></li>
            <li><a href="__URL__/newsletterQueue"><span>{$Think.lang.newsletter.newsletter_queue}</span></a></li>
        </ul>
    </div>
    <table class="tb tb2 fixpadding">
        <tr>
            <th>{$Think.lang.id}</th>
            <th>{$Think.lang.newsletter.subject}</th>
            <th>{$Think.lang.newsletter.target_group}</th>
            <th>{$Think.lang.newsletter.unsend_count}</th>
            <th>{$Think.lang.newsletter.last_send_time}</th>
            <th width="15%">{$Think.lang.actions}</th>
        </tr>
        <volist name="newsletterList" id="vo">
        <tr class="item">
            <td>{$vo.letter_id}</td>
            <td>{$vo.subject}</td>
            <td>
                <notempty name="vo.target_group">
                <volist name="vo.target_group" id="sub">
                    <a href="__APP__/Admin/User/userList/user_group/{$sub}">{$sub|get_group_name}</a>({$sub|get_group_user_count})&nbsp;&nbsp;<a href="__URL__/removeTargetGroup/letter_id/{$vo.letter_id}/group_id/{$sub}" title="{$Think.lang.newsletter.remove_group}"><img src="__STYLE__/close.gif" /></a><br/>
                </volist>
                <else/>
                {$Think.lang.null}
                </notempty>
            </td>
            <td>
                <gt name="vo.unsend_count" value="0">
                <a href="__URL__/newsletterQueue/letter_id/{$vo.letter_id}" title="{$Think.lang.newsletter.target_user}">{$vo.unsend_count}</a>
                <else/>{$vo.unsend_count}
                </gt>
            </td>
            <td><notempty name="vo.last_send_time">{$vo.last_send_time|format_date}<else/>{$Think.lang.newsletter.pending}</notempty></td>
            <td>
                <gt name="vo.unsend_count" value="0">
                <a href="__URL__/sendNewsletter/letter_id/{$vo.letter_id}" title="{$Think.lang.newsletter.send_now}">{$Think.lang.newsletter.send}</a>&nbsp;&nbsp;
                </gt>
                <a class="act" href="__URL__/editNewsletter/letter_id/{$vo.letter_id}">{$Think.lang.edit}</a>&nbsp;&nbsp;
                <a class="act" href="__URL__/deleteNewsletter/letter_id/{$vo.letter_id}">{$Think.lang.delete}</a>
            </td>
        </tr>
        </volist>
        <tr class="nobg">
            <td colspan="15">
                <div class="cuspages right"><div class="pages">{$pagination}</div></div>
            </td>
        </tr>
    </table>
</div>

<include file="Public:footer" />
